{% extends 'base.html' %}

{% block content %}
<h2>Assign tasks</h2>
<a href='{% url admin_assign_all %}'>To everyone</a> | <a href='{% url admin_assign_constituency %}'>By constituency</a>

{% for task, assigned, already_assigned in message %}
{% if assigned %}
Assigned <em>{{ task }}</em> to<br/>
<ul>
    {% for user in assigned %}
      <li>{{ user }}</li>
    {% endfor %}
</ul>
{% endif %}
{% if already_assigned %}
Already assigned <em>{{ task }}</em> to<br/>
<ul>
    {% for user in already_assigned %}
      <li>{{ user }}</li>
    {% endfor %}
</ul>
{% endif %}
{% endfor %}

<form action="" method="post">
  <table>
  {{ form.as_table }}
  <tr>
   <td></td>
   <td><input type="submit" value="assign" /></td>
  </tr>
  </table>
</form>
{% endblock %}
